<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="com.dic.service.WorddictionaryService"%>
<%@ page import="com.dic.dao.*"%>
<%@ page import="com.dic.dao.model.*"%>
<%@ page import="com.dic.dao.model.Worddictionary"%>
<%@ page import="com.google.gson.Gson" %>

<%
   request.setCharacterEncoding("UTF-8");
   response.setCharacterEncoding("UTF-8");
   
   String chinese=request.getParameter("chinese").trim();
   String compiler=request.getParameter("compiler").trim();
   
   HashMap<String,String> hm=new HashMap<String,String>();
   hm.put("chinese", chinese);
   hm.put("compiler", compiler);
   
   WorddictionaryService ser = new WorddictionaryService();
   Worddictionary worddic=new Worddictionary();
   worddic=ser.getWord(hm);
   
   //System.out.println(worddic.getChinese());
   
   Gson gson = new Gson();  
   String wordjson=gson.toJson(worddic); 
   //System.out.println(wordjson);
   out.print("{'wordjson':'"+wordjson+"'}");
   
%>